//---------------------------------------------------------------------------

#ifndef motionH
#define motionH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Grids.hpp>
#include <Menus.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
#include <ComCtrls.hpp>
#include <jpeg.hpp>
#include "YbCommDevice.h"
#include <Graphics.hpp>
#include "perfgrap.h"
#include "pies.h"
#include <ExtDlgs.hpp>

#define MOTOR_NUM 			27
#define POSITION_MIN		0
//#define POSITION_MAX 		1023
#define SPEED_MIN 			0
#define SPEED_MAX 			1023

#define RUN_TEMP_SCHEDULE 238

//---------------------------------------------------------------------------
class TFormMotion : public TForm
{
__published:	// IDE-managed Components
        TStringGrid *Motion;
        TMainMenu *MainMenu1;
        TMenuItem *mnuFile;
		TMenuItem *mnuOpenOld;
        TMenuItem *mnuAnother;
        TMenuItem *N1;
        TMenuItem *mnuExit;
        TMenuItem *mnuSetting;
        TMenuItem *mnuComm;
	TOpenDialog *OpenDialogMFile;
	TSaveDialog *SaveDialogMFile;
        TTimer *Timer_play;
        TProgressBar *ProgressBar1;
        TMenuItem *mnuOutput;
	TSaveDialog *SaveDialogMFileOutPut;
        TTimer *Timer_update;
        TOpenDialog *OpenDialogPlus;
        TSaveDialog *SaveDialogPlus;
	TGroupBox *GroupBox4;
	TLabel *Labelx1;
	TLabel *Label35;
	TEdit *Edit_p;
	TEdit *Edit_s;
	TButton *Button_fix;
	TGroupBox *GroupBox5;
	TPageControl *PageControl_Tool;
	TTabSheet *TabSheet1;
	TTabSheet *TabSheet4;
	TTabSheet *TabSheet5;
	TGroupBox *RemoteControlSet;
	TButton *Button_WALK_FFF;
	TButton *Button_SHIFT_LLL;
	TButton *Button_SHIFT_RRR;
	TButton *Button_WALK_BBB;
	TButton *Button_THROW;
	TButton *Button_PICKUP;
	TButton *Button_UPSTAIR;
	TButton *Button_DOWNSTAIR;
	TButton *Button_GETUP_F;
	TButton *Button_WALK_FF;
	TButton *Button_WALK_BB;
	TButton *Button_SHIFT_RR;
	TButton *Button_SHIFT_LL;
	TButton *Button_STANDING;
	TTabSheet *TabSheet6;
	TGroupBox *GroupBoxACC;
	TLabel *Label78;
	TLabel *Label_ACC_x;
	TLabel *Label79;
	TLabel *Label_ACC_y;
	TLabel *Label81;
	TLabel *Label_ACC_z;
	TGroupBox *GroupBoxACC_wave;
	TPerformanceGraph *PerformanceGraphACC;
	TGroupBox *GroupBoxGyro;
	TLabel *Label8;
	TLabel *Label_Gyro_x;
	TLabel *Label13;
	TLabel *Label_Gyro_y;
	TLabel *Label15;
	TLabel *Label_Gyro_z;
	TGroupBox *GroupBoxGyro_wave;
	TPerformanceGraph *PerformanceGraphGyro;
	TGroupBox *GroupBoxFroce;
	TLabel *Label9;
	TLabel *Label_ZMP_L;
	TLabel *Label16;
	TLabel *Label_ZMP_R;
	TGroupBox *GroupBoxZMP_Graph;
	TImage *ImageZMP;
	TPerformanceGraph *PerformanceGraphZMP;
	TGroupBox *GroupBox8;
	TLabel *Label17;
	TComboBox *ComboBox_Robot_Name;
	TStatusBar *StatusBar_down;
	TTimer *Timer_Sim;
	TGroupBox *GroupBoxRobotSize;
	TLabel *Label18;
	TPageControl *PageControl_RobotSize;
	TTabSheet *TabSheet3;
	TLabel *Label90;
	TLabel *Label91;
	TEdit *Edit_C1;
	TEdit *Edit_C2;
	TTabSheet *TabSheet7;
	TLabel *Label87;
	TLabel *Label88;
	TLabel *Label22;
	TEdit *Edit_B1;
	TEdit *Edit_B2;
	TEdit *Edit_B3;
	TTabSheet *TabSheet8;
	TLabel *Label20;
	TLabel *Label21;
	TEdit *Edit_H1;
	TEdit *Edit_H2;
	TTabSheet *TabSheet9;
	TLabel *Label23;
	TLabel *Label24;
	TLabel *Label92;
	TLabel *Label93;
	TEdit *Edit_L1;
	TEdit *Edit_L2;
	TEdit *Edit_L3;
	TEdit *Edit_L4;
	TTabSheet *TabSheet10;
	TLabel *Label19;
	TLabel *Label82;
	TLabel *Label86;
	TEdit *Edit_S_WI;
	TEdit *Edit_S_WO;
	TEdit *Edit_S_LF;
	TLabel *Label10;
	TComboBox *ComboBoxMotionName;
	TGroupBox *GroupBox6;
	TLabel *Label48;
	TLabel *Label_Send;
	TLabel *Label49;
	TLabel *Label_Receive;
	TGroupBox *GroupBox11;
	TLabel *Label1;
	TEdit *Edit_replay;
	TLabel *Label5;
	TEdit *Edit_delay;
	TButton *Button_insert;
	TButton *Button_del;
	TButton *Button_off;
	TGroupBox *GroupBox1;
	TLabel *Label2;
	TLabel *Label_re_A;
	TLabel *Label_re_B;
	TButton *Button_re_A;
	TButton *Button_re_B;
	TEdit *Edit_re_num;
	TButton *Button_re_can;
	TGroupBox *GroupBox3;
	TLabel *Label33;
	TLabel *Label34;
	TLabel *Label12;
	TLabel *Label11;
	TLabel *Label_Time;
	TLabel *Label_total;
	TLabel *LabelRow;
	TLabel *LabelCol;
	TLabel *Label_P;
	TLabel *Label76;
	TUpDown *UpDown1;
	TButton *Button_edit;
	TButton *Button_play;
	TButton *Button_mirror_LR;
	TGroupBox *GroupBoxBattery;
	TLabel *V1;
	TLabel *V2;
	TLabel *V3;
	TStaticText *StaticText24;
	TStaticText *StaticText25;
	TStaticText *StaticText26;
	TLabel *Label101;
	TEdit *Edit_C3;
	TLabel *Label102;
	TEdit *Edit_B4;
	TLabel *Label103;
	TEdit *Edit_B5;
	TLabel *Label104;
	TEdit *Edit_S_LR;
	TLabel *Label105;
	TEdit *Edit_C4;
	TLabel *Label106;
	TEdit *Edit_H3;
	TLabel *Label107;
	TEdit *Edit_H4;
	TImage *Image1;
	TTabSheet *TabSheet17;
	TMemo *Memo_CommSend;
	TMemo *Memo_Motor_data;
	TGroupBox *GroupBox17;
	TButton *Button_KICK_L;
	TButton *Button_KICK_LL;
	TButton *Button_KICK_LLL;
	TGroupBox *GroupBox19;
	TButton *Button_KICK_RRR;
	TButton *Button_KICK_RR;
	TButton *ButtonKICK_R;
	TGroupBox *GroupBox20;
	TGroupBox *GroupBox21;
	TGroupBox *GroupBox23;
	TButton *Button_TURNBALL_LLL;
	TButton *Button_TURNBALL_RRR;
	TButton *Button_TURN_RRR;
	TButton *Button_TURNBALL_LL;
	TButton *Button_TURNBALL_L;
	TButton *Button_TURNBALL_RR;
	TButton *Button_TURNBALL_R;
	TButton *Button_TURN_RR;
	TButton *Button_TURN_R;
	TGroupBox *GroupBox25;
	TButton *Button_DEFEND_LLL;
	TButton *Button_DEFEND_RRR;
	TButton *Button_DEFEND_LL;
	TButton *Button_DEFEND_RR;
	TButton *Button_DEFEND_L;
	TButton *Button_DEFEND_R;
	TButton *Button_WALK_F;
	TButton *Button_SHIFT_L;
	TButton *Button_SHIFT_R;
	TButton *Button_WALK_B;
	TShape *Shape1;
	TShape *Shape_Heading_Dir;
	TGroupBox *GroupBox24;
	TButton *Button_TURN_LLL;
	TButton *Button_TURN_LL;
	TButton *Button_TURN_L;
	TShape *Shape3;
	TShape *Shape4;
	TButton *Button_SQUAT;
	TGroupBox *GroupBox18;
	TButton *ButtonWaistLeft;
	TButton *ButtonWaistCenter;
	TButton *ButtonWaistRight;
	TGroupBox *GroupBox22;
	TScrollBar *ScrollBar_Motor1;
	TScrollBar *ScrollBar_Motor0;
	TLabel *Label77;
	TLabel *Label123;
	TButton *Button_STANDUP;
	TCheckBox *CheckBoxPolling;
	TCheckBox *CheckBox_MtnC;
	TGroupBox *GroupBox26;
	TLabel *Label74;
	TLabel *LabelDone;
	TLabel *LabelACK;
	TLabel *LabelRMTcom;
	TLabel *Label75;
	TLabel *Label73;
	TPageControl *PageControl1;
	TTabSheet *TabSheet18;
	TLabel *Label3;
	TEdit *Edit_Command;
	TEdit *Edit_Command_Head;
	TLabel *Label125;
	TTabSheet *TabSheet19;
	TTabSheet *TabSheet20;
	TLabel *Label45;
	TEdit *Edit_PICKUP;
	TEdit *Edit_THROW;
	TLabel *Label46;
	TLabel *Label31;
	TEdit *Edit_UPSTAIR;
	TEdit *Edit_DOWNSTAIR;
	TLabel *Label32;
	TLabel *Label47;
	TEdit *Edit_STANDING;
	TEdit *Edit_GETUP_B;
	TLabel *Label126;
	TLabel *Label40;
	TEdit *Edit_SQUAT;
	TEdit *Edit_STANDUP;
	TLabel *Label41;
	TLabel *Label37;
	TLabel *Label43;
	TLabel *Label44;
	TEdit *Edit_KICK_R;
	TEdit *Edit_KICK_L;
	TEdit *Edit_KICK_RR;
	TEdit *Edit_KICK_LL;
	TEdit *Edit_KICK_RRR;
	TEdit *Edit_WALK_FFF;
	TEdit *Edit_WALK_BBB;
	TEdit *Edit_WALK_FF;
	TEdit *Edit_WALK_BB;
	TEdit *Edit_WALK_F;
	TEdit *Edit_WALK_B;
	TLabel *Label4;
	TLabel *Label29;
	TEdit *Edit_SHIFT_RRR;
	TEdit *Edit_SHIFT_LLL;
	TEdit *Edit_SHIFT_RR;
	TEdit *Edit_SHIFT_LL;
	TEdit *Edit_SHIFT_R;
	TEdit *Edit_SHIFT_L;
	TLabel *Label26;
	TLabel *Label25;
	TEdit *Edit_TURN_RRR;
	TEdit *Edit_TURN_LLL;
	TEdit *Edit_TURN_RR;
	TEdit *Edit_TURN_LL;
	TEdit *Edit_TURN_R;
	TEdit *Edit_TURN_L;
	TLabel *Label27;
	TLabel *Label30;
	TEdit *Edit_TURNBALL_RRR;
	TEdit *Edit_TURNBALL_LLL;
	TEdit *Edit_TURNBALL_RR;
	TEdit *Edit_TURNBALL_LL;
	TEdit *Edit_TURNBALL_R;
	TEdit *Edit_TURNBALL_L;
	TLabel *Label28;
	TLabel *Label36;
	TEdit *Edit_DEFEND_RRR;
	TEdit *Edit_DEFEND_LLL;
	TEdit *Edit_DEFEND_RR;
	TEdit *Edit_DEFEND_LL;
	TEdit *Edit_DEFEND_R;
	TEdit *Edit_DEFEND_L;
	TLabel *Label38;
	TLabel *Label39;
	TEdit *Edit_KICK_LLL;
	TLabel *Label42;
	TEdit *Edit_STOP;
	TEdit *Edit_STEP;
	TLabel *Label127;
	TLabel *Label129;
	TLabel *Label130;
	TEdit *Edit_WALK;
	TEdit *Edit_SHIFT;
	TEdit *Edit_TURN;
	TEdit *Edit_TURNBALL;
	TLabel *Label131;
	TLabel *Label132;
	TButton *Button_STEP;
	TButton *ButtonSTOP;
	TButton *Button2;
	TEdit *Edit_Motor0;
	TEdit *Edit_Motor1;
	TLabel *Label133;
	TLabel *Label_ACC_x_max;
	TLabel *Label135;
	TLabel *Label_ACC_y_max;
	TLabel *Label137;
	TLabel *Label_ACC_z_max;
	TLabel *Label139;
	TLabel *Label_Gyro_x_max;
	TLabel *Label141;
	TLabel *Label_Gyro_y_max;
	TLabel *Label143;
	TLabel *Label_Gyro_z_max;
	TLabel *Label134;
	TLabel *Label_ACC_x_min;
	TLabel *Label138;
	TLabel *Label_ACC_y_min;
	TLabel *Label142;
	TLabel *Label_ACC_z_min;
	TLabel *Label145;
	TLabel *Label_Gyro_x_min;
	TLabel *Label147;
	TLabel *Label_Gyro_y_min;
	TLabel *Label149;
	TLabel *Label_Gyro_z_min;
	TButton *Button_REC;
	TLabel *Label6;
	TComboBox *ComboBox_Wave_axis;
	TLabel *Label7;
	TTrackBar *TrackBar_Wave_Scale;
	TLabel *Label_Wave_Scale;
	TButton *Button_Reset_Sensor_MinMax;
	TShape *Shape2;
	TPie *Pie_Gyro_x;
	TShape *Shape5;
	TPie *Pie_Gyro_y;
	TShape *Shape6;
	TPie *Pie_Gyro_z;
	TLabel *Label136;
	TLabel *Label144;
	TShape *Shape7;
	TShape *Shape8;
	TShape *Shape9;
	TLabel *Label140;
	TGroupBox *GroupBox16;
	TShape *Shape_Acc_x;
	TShape *Shape_Acc_y;
	TShape *Shape_Acc_z;
	TShape *Shape10;
	TShape *Shape11;
	TShape *Shape12;
	TShape *Shape13;
	TShape *Shape24;
	TShape *Shape25;
	TLabel *Label151;
	TLabel *Label_Force_R1;
	TLabel *Label153;
	TLabel *Label_Force_R2;
	TLabel *Label155;
	TLabel *Label_Force_R3;
	TLabel *Label157;
	TLabel *Label_Force_R4;
	TLabel *Label159;
	TLabel *Label160;
	TLabel *Label161;
	TLabel *Label162;
	TLabel *Label_Force_L1;
	TLabel *Label_Force_L2;
	TLabel *Label_Force_L3;
	TLabel *Label_Force_L4;
	TTabSheet *TabSheet21;
	TLabel *Label152;
	TLabel *Label_Total_G;
	TLabel *Label146;
	TLabel *Label148;
	TLabel *Label150;
	TLabel *Label154;
	TLabel *Label156;
	TLabel *Label158;
	TSaveDialog *SaveDialog_SensorRecord;
	TButton *Button_GETUP_B;
	TLabel *Label163;
	TEdit *Edit_GETUP_F;
	TTabSheet *TabSheet22;
	TButton *Button_HEAD_STOP;
	TLabel *Label164;
	TEdit *Edit_Command_Head_Mode;
	TButton *Button_HEAD_GO_SLOW;
	TButton *Button_HEAD_GO_MIDDLE;
	TButton *Button_HEAD_GO_FAST;
	TButton *Button_HEAD_SEARCH_UPPER;
	TButton *Button_HEAD_SEARCH_CENTER;
	TButton *Button_HEAD_SEARCH_LOWER;
	TButton *Button_HEAD_SEARCH_UPPER_CENTER;
	TButton *Button_HEAD_SEARCH_HALF_R;
	TButton *Button_HEAD_SEARCH_HALF_L;
	TButton *Button_HEAD_SEARCH_RADIATION_R;
	TButton *Button_HEAD_SEARCH_RADIATION_L;
	TEdit *Edit_HEAD_STOP;
	TEdit *Edit_HEAD_GO_SLOW;
	TEdit *Edit_HEAD_GO_MIDDLE;
	TEdit *Edit_HEAD_GO_FAST;
	TEdit *Edit_HEAD_SEARCH_UPPER;
	TEdit *Edit_HEAD_SEARCH_CENTER;
	TEdit *Edit_HEAD_SEARCH_LOWER;
	TEdit *Edit_HEAD_SEARCH_UPPER_CENTER;
	TEdit *Edit_HEAD_SEARCH_HALF_R;
	TEdit *Edit_HEAD_SEARCH_HALF_L;
	TEdit *Edit_HEAD_SEARCH_RADIATION_R;
	TEdit *Edit_HEAD_SEARCH_RADIATION_L;
	TLabel *Label165;
	TLabel *Label_Heading_Direction;
	TPie *Pie_Heading_Dir;
	TTrackBar *TrackBar_Heading_Distance;
	TLabel *Label166;
	TLabel *Label_Heading_Distance;
	TLabel *Label14;
	TEdit *Edit_SpeedFactor;
	TCheckBox *CheckBox_GenerateABOnly;
	TButton *Button_Cancel_play;
	TButton *Button_add;
	TButton *Button_mirror_FR;
	TStringGrid *Motion_temp;
	TLabel *Label167;
	TEdit *Edit_RaiseArm;
	TButton *Button_RaiseArm;
	TButton *Button_START_REC;
	TButton *Button_END_REC;
	TSavePictureDialog *SavePictureDialog_3View;
	TYbCommDevice *VComm;
	TEdit *Edit_saveREC;
	TLabel *Label172;
	TLabel *Label_ThrowDis;
	TEdit *Edit_ThrowDis;
	TButton *Button_ClearMemoRx;
	TButton *Button_ClearMemoTx;
	TRadioGroup *RadioGroup_RxSelection;
	TEdit *Edit_ZigbeeKeyIn;
	TLabel *Label174;
	TCheckBox *CheckBox_KeyInCheck;
	TLabel *Label175;
	TEdit *Edit_FreeKeyIn;
	TCheckBox *CheckBox_send_rd;
	TGroupBox *GroupBox_Lift;
	TButton *Button_LIFT_L2M;
	TEdit *Edit_LIFT_L2M;
	TButton *Button_LIFT_WALKM;
	TEdit *Edit_LIFT_WALKM;
	TButton *Button_LIFT_M2H;
	TEdit *Edit_LIFT_M2H;
	TButton *Button_LIFT_WALKH;
	TEdit *Edit_LIFT_WALKH;
	TMenuItem *mnuMotionTable;
	TSaveDialog *SaveDialogMTableOutput;
	TCheckBox *CheckBox_ConnectSim;
	TButton *Button_ZigbeeGetReadData;
	TPageControl *PageControl_GaitGeneration;
	TTabSheet *TabSheet24;
	TRadioGroup *RadioGroup_VelocityMode;
	TGroupBox *GroupBox33;
	TLabel *Label200;
	TEdit *Edit_Tratio;
	TCheckBox *CheckBox_ConnectMotionController;
	TButton *Button_re;
	TButton *Button_ShowLIPM;
	TGroupBox *GroupBox2;
	TLabel *Label50;
	TEdit *Edit_TempMotion_RepeatCount;
	TButton *Button_TempMotion_Run;
	TMenuItem *mnuDoc;
	TMenuItem *mnuUpdatingRecords;
	TMenuItem *mnuOutputPartition;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall MotionSelectCell(TObject *Sender, int ACol,
          int ARow, bool &CanSelect);
        void __fastcall menuExitClick(TObject *Sender);
        void __fastcall menuOpenMFileClick(TObject *Sender);
        void __fastcall Button_editClick(TObject *Sender);
        void __fastcall Button_reClick(TObject *Sender);
        void __fastcall MotionKeyPress(TObject *Sender, char &Key);
        void __fastcall menuSaveMFileClick(TObject *Sender);
		//void __fastcall Comm1ReceiveData(TObject *Sender);
        void __fastcall Button_playClick(TObject *Sender);
        void __fastcall MotionDblClick(TObject *Sender);
        void __fastcall Button_addClick(TObject *Sender);
        void __fastcall MotionMouseUp(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
        void __fastcall Timer_playTimer(TObject *Sender);
        void __fastcall menuOutputClick(TObject *Sender);
        void __fastcall Edit_pKeyPress(TObject *Sender, char &Key);
        void __fastcall Edit_sKeyPress(TObject *Sender, char &Key);
        void __fastcall mnuCommClick(TObject *Sender);
        void __fastcall MotionKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
        void __fastcall FormShow(TObject *Sender);
        void __fastcall Button_mirror_LRClick(TObject *Sender);
        void __fastcall Button_fixClick(TObject *Sender);
        void __fastcall Button_insertClick(TObject *Sender);
        void __fastcall Button_delClick(TObject *Sender);
        void __fastcall Button_re_AClick(TObject *Sender);
        void __fastcall Button_re_BClick(TObject *Sender);
        void __fastcall Button_re_canClick(TObject *Sender);
        void __fastcall UpDown1Click(TObject *Sender, TUDBtnType Button);
        void __fastcall Button_offClick(TObject *Sender);
		void __fastcall FormKeyPress(TObject *Sender, char &Key);

	void __fastcall VCommCommNotify(TObject *Sender, int NotifyType);
	void __fastcall PageControl_ToolChange(TObject *Sender);
	void __fastcall Edit_SpeedFactorKeyPress(TObject *Sender, wchar_t &Key);
	void __fastcall MotionMouseEnter(TObject *Sender);
	void __fastcall MotionMouseLeave(TObject *Sender);
	void __fastcall ButtonSimPauseClick(TObject *Sender);
	void __fastcall Timer_updateTimer(TObject *Sender);
	void __fastcall Button_WALK_FFFClick(TObject *Sender);
	void __fastcall Button_WALK_FFClick(TObject *Sender);
	void __fastcall Button_WALK_FClick(TObject *Sender);
	void __fastcall Button_WALK_BBBClick(TObject *Sender);
	void __fastcall Button_WALK_BBClick(TObject *Sender);
	void __fastcall Button_WALK_BClick(TObject *Sender);
	void __fastcall Button_SHIFT_LLLClick(TObject *Sender);
	void __fastcall Button_SHIFT_LLClick(TObject *Sender);
	void __fastcall Button_SHIFT_LClick(TObject *Sender);
	void __fastcall Button_SHIFT_RRRClick(TObject *Sender);
	void __fastcall Button_SHIFT_RRClick(TObject *Sender);
	void __fastcall Button_SHIFT_RClick(TObject *Sender);
	void __fastcall Button_TURN_LLLClick(TObject *Sender);
	void __fastcall Button_TURN_LLClick(TObject *Sender);
	void __fastcall Button_TURN_LClick(TObject *Sender);
	void __fastcall Button_TURN_RRRClick(TObject *Sender);
	void __fastcall Button_TURN_RRClick(TObject *Sender);
	void __fastcall Button_TURN_RClick(TObject *Sender);
	void __fastcall Button_TURNBALL_LLLClick(TObject *Sender);
	void __fastcall Button_TURNBALL_LLClick(TObject *Sender);
	void __fastcall Button_TURNBALL_LClick(TObject *Sender);
	void __fastcall Button_TURNBALL_RRRClick(TObject *Sender);
	void __fastcall Button_TURNBALL_RRClick(TObject *Sender);
	void __fastcall Button_TURNBALL_RClick(TObject *Sender);
	void __fastcall Button_KICK_LLLClick(TObject *Sender);
	void __fastcall Button_KICK_LLClick(TObject *Sender);
	void __fastcall Button_KICK_LClick(TObject *Sender);
	void __fastcall Button_KICK_RRRClick(TObject *Sender);
	void __fastcall Button_KICK_RRClick(TObject *Sender);
	void __fastcall ButtonKICK_RClick(TObject *Sender);
	void __fastcall Button_DEFEND_LLLClick(TObject *Sender);
	void __fastcall Button_DEFEND_LLClick(TObject *Sender);
	void __fastcall Button_DEFEND_LClick(TObject *Sender);
	void __fastcall Button_DEFEND_RRRClick(TObject *Sender);
	void __fastcall Button_DEFEND_RRClick(TObject *Sender);
	void __fastcall Button_DEFEND_RClick(TObject *Sender);
	void __fastcall Button_STANDINGClick(TObject *Sender);
	void __fastcall Button_SQUATClick(TObject *Sender);
	void __fastcall Button_THROWClick(TObject *Sender);
	void __fastcall Button_PICKUPClick(TObject *Sender);
	void __fastcall Button_UPSTAIRClick(TObject *Sender);
	void __fastcall Button_DOWNSTAIRClick(TObject *Sender);
	void __fastcall Button_STEPClick(TObject *Sender);
	void __fastcall ButtonSTOPClick(TObject *Sender);
	void __fastcall ScrollBar_Motor1Change(TObject *Sender);
	void __fastcall ScrollBar_Motor0Change(TObject *Sender);
	void __fastcall Button2Click(TObject *Sender);
	void __fastcall Edit_Motor0KeyPress(TObject *Sender, wchar_t &Key);
	void __fastcall Edit_Motor1KeyPress(TObject *Sender, wchar_t &Key);
	void __fastcall TrackBar_Wave_ScaleChange(TObject *Sender);
	void __fastcall Button_Reset_Sensor_MinMaxClick(TObject *Sender);
	void __fastcall Button_RECClick(TObject *Sender);
	void __fastcall Button_GETUP_FClick(TObject *Sender);
	void __fastcall Button_GETUP_BClick(TObject *Sender);
	void __fastcall Button_STANDUPClick(TObject *Sender);
	void __fastcall Button_HEAD_STOPClick(TObject *Sender);
	void __fastcall Button_HEAD_GO_SLOWClick(TObject *Sender);
	void __fastcall Button_HEAD_GO_MIDDLEClick(TObject *Sender);
	void __fastcall Button_HEAD_GO_FASTClick(TObject *Sender);
	void __fastcall Button_HEAD_SEARCH_UPPERClick(TObject *Sender);
	void __fastcall Button_HEAD_SEARCH_CENTERClick(TObject *Sender);
	void __fastcall Button_HEAD_SEARCH_LOWERClick(TObject *Sender);
	void __fastcall Button_HEAD_SEARCH_UPPER_CENTERClick(TObject *Sender);
	void __fastcall Button_HEAD_SEARCH_HALF_RClick(TObject *Sender);
	void __fastcall Button_HEAD_SEARCH_HALF_LClick(TObject *Sender);
	void __fastcall Button_HEAD_SEARCH_RADIATION_RClick(TObject *Sender);
	void __fastcall Button_HEAD_SEARCH_RADIATION_LClick(TObject *Sender);
	void __fastcall Pie_Heading_DirMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift,
          int X, int Y);
	void __fastcall TrackBar_Heading_DistanceChange(TObject *Sender);
	void __fastcall Button_Cancel_playClick(TObject *Sender);
	void __fastcall Button_mirror_FRClick(TObject *Sender);
	void __fastcall Button_RaiseArmClick(TObject *Sender);
	void __fastcall Button_START_RECClick(TObject *Sender);
	void __fastcall Button_END_RECClick(TObject *Sender);
	void __fastcall Button_ClearMemoRxClick(TObject *Sender);
	void __fastcall Button_ClearMemoTxClick(TObject *Sender);
	void __fastcall Edit_ZigbeeKeyInKeyPress(TObject *Sender, wchar_t &Key);
	void __fastcall Edit_FreeKeyInKeyPress(TObject *Sender, wchar_t &Key);
	void __fastcall RadioGroup_RxSelectionClick(TObject *Sender);
	void __fastcall Button_LIFT_L2MClick(TObject *Sender);
	void __fastcall Button_LIFT_WALKMClick(TObject *Sender);
	void __fastcall Button_LIFT_M2HClick(TObject *Sender);
	void __fastcall Button_LIFT_WALKHClick(TObject *Sender);
	void __fastcall mnuMotionTableClick(TObject *Sender);
	void __fastcall CheckBox_ConnectSimClick(TObject *Sender);
	void __fastcall RadioGroup_VelocityModeClick(TObject *Sender);
	void __fastcall Button_ZigbeeGetReadDataClick(TObject *Sender);
	void __fastcall Edit_TratioKeyPress(TObject *Sender, wchar_t &Key);
	void __fastcall CheckBox_ConnectMotionControllerClick(TObject *Sender);
	void __fastcall Button_ShowLIPMClick(TObject *Sender);
	void __fastcall Button_TempMotion_RunClick(TObject *Sender);
	void __fastcall mnuUpdatingRecordsClick(TObject *Sender);
	void __fastcall mnuOutputPartitionClick(TObject *Sender);

private:	// User declarations
public:		// User declarations
		__fastcall TFormMotion(TComponent* Owner);
		Graphics::TBitmap *OrgBitmapYZ;
		Graphics::TBitmap *OrgBitmapXZ;
		Graphics::TBitmap *OrgBitmapXY;
	bool StringToTX(AnsiString str_TX, unsigned char* TX, int TX_length);
	void Clear_TX(unsigned char* TX, int TX_length);
	void ReadVcomm();
};
//---------------------------------------------------------------------------
extern PACKAGE TFormMotion *FormMotion;
//---------------------------------------------------------------------------
#endif
